Skip to content

[Fiber] Make requestIdleCallback() and requestAnimationFrame() shims async#8591

Merged
gaearon merged 4 commits intofacebook:masterfrom
gaearon:async-shims
Dec 21, 2016
Merged

[Fiber] Make requestIdleCallback() and requestAnimationFrame() shims async#8591
gaearon merged 4 commits intofacebook:masterfrom
gaearon:async-shims

Conversation

@gaearon
Copy link
Copy Markdown
Collaborator

@gaearon gaearon commented Dec 17, 2016

They no longer need to be sync in tests because we already made DOM renderer sync by default.
This fixes a crash when testing incrementalness in DOM renderer itself.

They no longer need to be sync in tests because we already made DOM renderer sync by default.
This fixes a crash when testing incrementalness in DOM renderer itself.
@gaearon gaearon requested a review from acdlite December 17, 2016 01:14
@gaearon gaearon changed the title Make requestIdleCallback() and requestAnimationFrame() shims async [Fiber] Make requestIdleCallback() and requestAnimationFrame() shims async Dec 17, 2016
Copy link
Copy Markdown
Collaborator

@acdlite acdlite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

callback({ timeRemaining() { return Infinity; } });
setTimeout(() => {
callback({ timeRemaining() { return Infinity; } });
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that it really matters but

setTimeout(callback, 0, { timeRemaining() { return Infinity; } });

would save an allocation :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today I learned. I don't care though—it's tests. 😄

@gaearon gaearon merged commit a27e4f3 into facebook:master Dec 21, 2016
@gaearon gaearon deleted the async-shims branch December 21, 2016 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants